/*
 * ScenarioView.h
 *
 *  Created on: 01/06/2014
 *      Author: javier
 */

#ifndef SCENARIOVIEW_H_
#define SCENARIOVIEW_H_

#include "DrawableFactory.h"
#include "BZPModel.h"
#include "Camera.h"
#include "Mutex.h"
#include "Properties.h"
#include <list>

class BZPView;

class ScenarioView {
public:
	ScenarioView(BZPView* view, BZPModel* model, SDLWindow* window);
	void add(Positionable* positionable);
	void addExplosion(Positionable* positionable);
	void update();
	void removeView(int id);
	void render();
	void setTarget(Positionable* p);
	void clear();
	void handleClick(int x, int y);
	void setScenarioDimensions(int x, int y);
	virtual ~ScenarioView();
private:
	DrawableFactory factory;
	BZPModel* model;
	BZPView* view;
	Camera cam;
	std::map<int, Drawable*> views;
	std::list<Drawable*> viewsList;
	std::list<Drawable*> viewsBackgroundList;
	int width, height;
	Mutex m;
	Properties properties;
	int idTarget;
};

#endif /* SCENARIOVIEW_H_ */
